<!DOCTYPE html>
<html lang="en">
<!--<script src="myscript.js"></script>-->
<head>
    <meta charset="UTF-8">
    <title>js类型转换</title>
    <script type="text/javascript">

        document.write("<h1> 这是一个简介 </h1>")
        document.write("<h1> 这也是一个简介 </h1>")

    </script>

    <script>
        var a = "hello world"
        var b = "nice javascript"
        var c = "nice java"
        var str = "python|java|js|php"
        var big = "HELLO WORLD"
        var num = 1
        var g = "   hello world 1   "
        var strNum = "123455"
        var strNumFloat = "123.11"
        var dict = {first: 1, second: 2, third: 3}
        var myList = [1, 2, 3]

        var mydate = new Date()

        function retLog(msg) {
            console.log(msg)
        }

        var n = big.search(/WOR/i) // 返回子串其实位置
        retLog(n)

        var m = big.replace(/WOR/i, "wor")
        retLog(m)

        var pattern = /WOR/
        retLog( pattern.test(big))




    </script>
</head>
<body>
<button type="button" onclick="alert('hello world')">点击我</button>
</body>
</html>